{*
 * @author 		Zprofess <contact@zprofess.com>
 * @copyright  	2011 Zprofess
 * @version  	1.0 
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *}

{php}
	global $smarty, $cookie;

	$zProductReview = new ZProductReview();
	$smarty->assign(array(
		'zProductReview'		=> $zProductReview,
		'configRating' 			=> ZprofessConfigure::$configRating,
		'only_review' 			=> (int)Configuration::get('ZPRO_ONLY_REVIEW'),
	));
{/php}

{assign var='nbReviews' value=$zProductReview->getReviewNumber($product.id_product)}
<p style="margin:0 5px;">{$nbReviews} Customer Reviews</p>
{if !{$only_review}}
	{assign var='averageTotal' value=$zProductReview->getAveragesByProduct($product.id_product, null, true)}
	<div style="margin-left:3px;margin-bottom: 5px; text-decoration: none;">
		<div class="average_total">
			<div id="features-raty-{$product.id_product}" class="displayAverageZprofess_{$product.id_product}"></div>
			<script type="text/javascript">
				$(".displayAverageZprofess_{$product.id_product}").raty({									
					width: 			{$configRating['width']},
					cancel: 		{$configRating['cancel']},						
					cancelHint:   	"{$configRating['cancelHint']}",  
					cancelOff:  	"{$configRating['cancelOff']}",
					cancelOn:   	"{$configRating['cancelOn']}", 	
					cancelPlace:  	"{$configRating['cancelPlace']}", 
				
					half:  			true,
					space:       	false,
					hintList:		{$configRating['hintList']},
					noRatedMsg:		"{$configRating['noRatedMsg']}",
					number:     	{$configRating['number']},
					path:           "{$configRating['path']}",	
					starHalf:		"{$configRating['starHalf']}",
					starOff:		"{$configRating['starOff']}",
					starOn:			"{$configRating['starOn']}",
					readOnly:		true,
					start: 			{$averageTotal|round},
				});
			</script>
		</div>
	</div>
{/if}